package dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;


public class ConnectionDB {
	static Connection conn;
	
	public ConnectionDB() {};
	
	public static Connection getConnection() throws SQLException, ClassNotFoundException {		
		Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
		conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DatabaseName=PA_system","sa","123456");
		conn.setAutoCommit(false);
		
		return conn;
	}
	
	public static void closeConnection() throws SQLException {
		conn.close();
	}
}
